// https://bugzilla.gnome.org/show_bug.cgi?id=596695 for
// details.) So we check now. (Have to do this after calling
// _updateSelection.)
- let [screen, x, y, mods] = Gdk.Display.get_default().get_pointer();
+ let mods = global.get_modifier_keys();
if (!(mods & Gdk.ModifierType.MOD1_MASK)) {
this._finish();
return false;
meta_screen_get_monitor_geometry (screen, 0, &rect);
return g_boxed_copy (GDK_TYPE_RECTANGLE, &rect);
}
+
+/**
+ * shell_global_get_modifier_keys:
+ * @global: the #ShellGlobal
+ *
+ * Gets the current set of modifier keys that are pressed down;
+ * this is a wrapper around gdk_display_get_pointer() that strips
+ * out any un-declared modifier flags, to make gjs happy; see
+ * https://bugzilla.gnome.org/show_bug.cgi?id=597292.
+ *
+ * Return value: the current modifiers
+ */
+GdkModifierType
+shell_global_get_modifier_keys (ShellGlobal *global)
+{
+ GdkModifierType mods;
+
+ gdk_display_get_pointer (gdk_display_get_default (), NULL, NULL, NULL, &mods);
+ return mods & GDK_MODIFIER_MASK;
+}
GdkRectangle *shell_global_get_primary_monitor (ShellGlobal *global);
GdkRectangle *shell_global_get_focus_monitor (ShellGlobal *global);
+GdkModifierType shell_global_get_modifier_keys (ShellGlobal *global);
+
G_END_DECLS
#endif /* __SHELL_GLOBAL_H__ */